/*底部弹窗*/
(function (lib,config) {
    //配置对象 WSF.config
    /*
    WSF.config = WSF.config || {
        id: '0',
        speechid: '0',
        styleid: '0', 1=绝对 2=全屏 3=锚点
        words: '',关键词用|分割
        bgcolor: '',背景颜色 13a4db
        textcolor: '',文本颜色
        dotname:'',医生姓名
        imglink: '',头像链接
        weblink: '',商务通链接
        flashid: '0',保留 动画参数
        positionid: '0',位置id 1-9 styleid=1有效 
        firsttime: '0',首次弹出时间
        relapsetime: '0',重复弹出间隔
        eachtime: '0',显示时长
        iscomapp: '0',是否兼容百度app
        identifier: '',附加标识符
        isstatus: '0',
        adddate: '-2147483648'
    }
    */
    /* 正式
    if (!WSF || !WSF.config) return;
    var config = WSF.config;
    */
    if (!lib) return;
    var loadFunc = function () {
        var wordAry = config.words.split('|');
        var _FooterFloat = '<div class="footbottom"></div>';
        var _SwtHtml = '<div class="swtdw" id="swtdingwei">' + '<div class="swtb" onclick="onclick=\"clicktc(\'chatwin\',\'&e=bottom_tan_' + config.identifier + '\');LR_HideInvite();return false;" >' + '</div></div>';
        document.writeln(_FooterFloat);
        document.writeln(_SwtHtml);
        var _fSwtHtm = '<div id="toopl" class="shadow"></div><div id="footTool" class="float_container cf"><div class="title">' + config.dotname + '<a class=\"zixun_gb\" href="javascript:void(0);" target="_self"></a></div><dl id="tools2" class="cf swt-db">' + '<dt><img src="' + config.imglink + '"></dt><dd><div id="now1" class="time1">11:14:20</div>' + '<div class="box1">' + wordAry[0] + '</div></dd></dl><dl id="tools3" class="cf swt-db">' + '<dt><img src="' + config.imglink + '"></dt><dd><div id="now2" class="time1">11:14:20</div>' + '<div class="box1">' + wordAry[1] + '</div>' + '</dd></dl><div class="btns cf"><a href="javascript:void(0)" onclick="clicktc(\'chatwin\',\'&e=bottom_tanzx_' + config.positionid + '_' + config.identifier + '\');return false;" >马上咨询</a><a href="javascript:void(0)" onclick="clicktc(\'chatwin\',\'&e=bottom_tanhh_' + config.positionid + '_' + config.identifier + '\');return false;" class="sd">立即回复</a></div></div>';
        document.writeln(_fSwtHtm);
        document.writeln('<style type="text/css">#LR-BTN{display: none;}.sd {animation: change 1s  ease-in  infinite ;}@keyframes change {0%{ background-color: #F9CA74}50%{ background-color:#f30}100%{ background-color:#F9CA74}}.swt-db { display: block; }.float_container { display: none; position: fixed; width: 100%; left: 0; bottom: 0; z-index: 9999999; background-image: linear-gradient(#abe5ef, #deceb7);}.cf { zoom: 1; }.cf:before, .cf:after { display: block; content: ""; }.cf:after { clear: both; }.swtdb { display: block}.shadow { z-index: 999990; display:none; position: fixed; width: 100%; height: 100%; top: 0; left: 0; background-color: rgba(0,0,0,.2); }.float_container .title { background: ' + config.bgcolor + '; font-size: 16px;height: 40px;  line-height: 34px; text-align: center; color: #fff; }.float_container .zixun_gb{ display: block; width: 51px; height: 51px; margin-top: -40px; margin-left: 85%; background: url(http://m.hhzjnk120.com/images/bottom_tan/gb.png) center center no-repeat; background-size: 40px; }.float_container dl { display: none; margin: 0; padding: 0; }.float_container dt { display: inline-block; width:68px; float: left; margin: 3px 0 0 8px; text-align: center; }.float_container dt img { max-width: 100%; border: 0; border-radius: 50%;width: 68px;height: 68px; vertical-align: middle; -ms-interpolation-mode: bicubic; }.float_container dd { margin: 0; display: inline-block; position: relative; width: 68%; float: left;  }.float_container .time1 { font-size: 12px; line-height: 1.6; color: #6c6761; text-align: center; width: 100%; margin: 0; height: 1.6em; }.float_container .box1 {line-height: 25px;padding: 10px; font:14px simsun,Microsoft YaHei,arial; text-align:left; color: ' + config.textcolor + '; position: relative; margin-left: 5%;  border: 1px solid #7ebbe4; border-top-color: #b2daf0; border-radius: 12px; box-shadow: 0 3px 0 #3ea0dd, inset 0 1px 1px #fff;background-color:#c6e5fa;background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #c6e5fa), color-stop(100%, #a6d7f7));background-image: -webkit-linear-gradient(top, #c6e5fa, #a6d7f7);background-image: -moz-linear-gradient(top, #c6e5fa, #a6d7f7);background-image: -ms-linear-gradient(top, #c6e5fa, #a6d7f7);background-image: -o-linear-gradient(top, #c6e5fa, #a6d7f7);background-image: linear-gradient(top, #c6e5fa, #a6d7f7);letter-spacing: -1px; }.float_container .box1 img { width: 22px; vertical-align: bottom; }.float_container .box1:before,.float_container .box1:after { position: absolute; content: ""; }.float_container .box1:before { width: 18px; height: 13px; top: -1px; left: -9px; background: url(http://m.hhzjnk120.com/images/bottom_tan/arrow.png) 0 0 no-repeat; background-size: 18px; }.float_container .box1:after { width: 40px; height: 26px; bottom: -4px; right: -7px; background: url(http://m.hhzjnk120.com/images/wave.png) 0 0 no-repeat; background-size: 40px; }.float_container .btns { margin-top: 6px; padding:10px 0; border-top:1px solid #c7c7c0; border-bottom:1px solid #979185; background-color: #eaebed; overflow:hidden; }.float_container .btns a { display: inline-block; width: 39%; height: 2em; float:left; margin:0 5%;border-radius: 12px; background-color: #F9CA74; box-shadow: 0 2px 2px #d1d1d3; font-size: 16px; color:#2C1703; line-height: 2; text-align: center; text-decoration: none; transition:all .3s linear 0s;  }.float_container .btns a:hover {border-color:#959490;background-color: #f7f7f7 }@media screen and (max-width: 320px) {.float_container .title { font-size: 18px; background-size: 32px; }.float_container dd { width: 73%; }.float_container .box1 { font-size: 13px; } .box1 p {line-height: 1.5em !important;}.float_container .btns a { border-radius: 10px; font-size: 15px; }}</style>');

        function getTimeStr(offset) {
            if (!arguments.length) offset = 0;
            var now = new Date();
            return [now.getHours(), now.getMinutes(), now.getSeconds() + offset].map(function (key) { return getNumStr(key); }).join(':');
        }
        function getNumStr(number) {
            return number < 10 ? '0' + number : '' + number;
        }
        document.getElementById('now1').innerHTML = getTimeStr(), document.getElementById('now2').innerHTML = getTimeStr(5);
        var footTool = document.getElementById("footTool");
        var toopl = document.getElementById("toopl");
        var tools2 = document.getElementById("tools2");
        var tools3 = document.getElementById("tools3");
        var audio = document.getElementById('chatAudio');
        setTimeout(toolshow, config.firsttime * 1000);
        //function testAudio() {
        //    audio.play();
        //    audio.pause();
        //}
        function toolshow() {
            document.getElementById('swtdingwei').style.display = 'none';
            footTool.className = "float_container swtdb cf";
            toopl.style.display = "none";
            setTimeout(toolshow2, 0);
            if (config.eachtime > 0) setTimeout(toolclose, config.eachtime * 1000);
            //audio.play();
        }
        function toolshow2() {
            tools2.style.display = "block";
        }
        function toolshow3() {
            tools3.style.display = "block";
            //audio.play();
        }
        function toolclose() {
            footTool.className = "float_container";
            toopl.style.display = "none";
            document.getElementById('swtdingwei').style.display = 'block';
            tools2.style.display = "none";
            tools3.style.display = "none";
            if (config.relapsetime) setTimeout(toolshow, config.relapsetime * 1000);
        }
        document.getElementsByClassName('zixun_gb')[0].addEventListener('click', toolclose);
    }
    lib.load(loadFunc);// 执行
})('{{lib}}','{{config}}');



